home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ShareWare OnLine 2
/
ShareWare OnLine Volume 2 (CMS Software)(1993).iso
/
util2
/
vol12n11.zip
/
OLFONT.ZIP
/
OLFDEMO.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-02-03
|
2KB
|
67 lines
/*-----------------------------------------------------
OLFDEMO.C -- OS/2 Outline Fonts Demonstration Shell
(c) Charles Petzold, 1993
-----------------------------------------------------*/
#define INCL_WIN
#define INCL_GPI
#include <os2.h>
extern void PaintClient (HPS hps, SHORT cxClient, SHORT cyClient) ;
MRESULT EXPENTRY ClientWndProc (HWND, ULONG, MPARAM, MPARAM) ;
int main (void)
{
static CHAR szClientClass [] = "OlfDemo" ;
static ULONG flFrameFlags = FCF_TITLEBAR | FCF_SYSMENU |
FCF_SIZEBORDER | FCF_MINMAX |
FCF_SHELLPOSITION | FCF_TASKLIST ;
HAB hab ;
HMQ hmq ;
HWND hwndFrame, hwndClient ;
QMSG qmsg ;
hab = WinInitialize (0) ;
hmq = WinCreateMsgQueue (hab, 0) ;
WinRegisterClass (hab, szClientClass, ClientWndProc, CS_SIZEREDRAW, 0) ;
hwndFrame = WinCreateStdWindow (HWND_DESKTOP, WS_VISIBLE,
&flFrameFlags, szClientClass,
NULL, 0L, NULLHANDLE, 0, &hwndClient) ;
while (WinGetMsg (hab, &qmsg, NULLHANDLE, 0, 0))
WinDispatchMsg (hab, &qmsg) ;
WinDestroyWindow (hwndFrame) ;
WinDestroyMsgQueue (hmq) ;
WinTerminate (hab) ;
return 0 ;
}
MRESULT EXPENTRY ClientWndProc (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{
static SHORT cxClient, cyClient ;
HPS hps ;
switch (msg)
{
case WM_SIZE:
cxClient = LOUSHORT (mp2) ;
cyClient = HIUSHORT (mp2) ;
return 0 ;
case WM_PAINT:
hps = WinBeginPaint (hwnd, NULLHANDLE, NULL) ;
GpiErase (hps) ;
PaintClient (hps, cxClient, cyClient) ;
WinEndPaint (hps) ;
return 0 ;
}
return WinDefWindowProc (hwnd, msg, mp1, mp2) ;
}